package org.cs.publics.model;
// Generated 2018-12-28 17:39:08 by Hibernate Tools 5.2.3.Final

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Discount generated by hbm2java
 */
@Entity
@Table(name = "discount", catalog = "good_fresh")
public class Discount implements java.io.Serializable {

	private Integer discountId;
	private UserInfo userInfo;
	private String discountName;
	private String discountRule;
	private Long discountMoney;
	private Date discountStartTime;
	private Date discountEndTime;
	private Integer discountState;
	private String discountScheme;
	private Date createTime;
	private Date updateTime;
	private String goodsHoldOne;
	private String goodsHoldTwo;
	private Set<OrderInfo> orderInfos = new HashSet<OrderInfo>(0);

	public Discount() {
	}

	public Discount(UserInfo userInfo, String discountName, String discountRule, Long discountMoney,
			Date discountStartTime, Date discountEndTime, Integer discountState, String discountScheme, Date createTime,
			Date updateTime, String goodsHoldOne, String goodsHoldTwo, Set<OrderInfo> orderInfos) {
		this.userInfo = userInfo;
		this.discountName = discountName;
		this.discountRule = discountRule;
		this.discountMoney = discountMoney;
		this.discountStartTime = discountStartTime;
		this.discountEndTime = discountEndTime;
		this.discountState = discountState;
		this.discountScheme = discountScheme;
		this.createTime = createTime;
		this.updateTime = updateTime;
		this.goodsHoldOne = goodsHoldOne;
		this.goodsHoldTwo = goodsHoldTwo;
		this.orderInfos = orderInfos;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)

	@Column(name = "DISCOUNT_ID", unique = true, nullable = false)
	public Integer getDiscountId() {
		return this.discountId;
	}

	public void setDiscountId(Integer discountId) {
		this.discountId = discountId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "USER_INFO_ID")
	public UserInfo getUserInfo() {
		return this.userInfo;
	}

	public void setUserInfo(UserInfo userInfo) {
		this.userInfo = userInfo;
	}

	@Column(name = "DISCOUNT_NAME", length = 25)
	public String getDiscountName() {
		return this.discountName;
	}

	public void setDiscountName(String discountName) {
		this.discountName = discountName;
	}

	@Column(name = "DISCOUNT_RULE", length = 50)
	public String getDiscountRule() {
		return this.discountRule;
	}

	public void setDiscountRule(String discountRule) {
		this.discountRule = discountRule;
	}

	@Column(name = "DISCOUNT_MONEY", precision = 10, scale = 0)
	public Long getDiscountMoney() {
		return this.discountMoney;
	}

	public void setDiscountMoney(Long discountMoney) {
		this.discountMoney = discountMoney;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "DISCOUNT_START_TIME", length = 19)
	public Date getDiscountStartTime() {
		return this.discountStartTime;
	}

	public void setDiscountStartTime(Date discountStartTime) {
		this.discountStartTime = discountStartTime;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "DISCOUNT_END_TIME", length = 19)
	public Date getDiscountEndTime() {
		return this.discountEndTime;
	}

	public void setDiscountEndTime(Date discountEndTime) {
		this.discountEndTime = discountEndTime;
	}

	@Column(name = "DISCOUNT_STATE")
	public Integer getDiscountState() {
		return this.discountState;
	}

	public void setDiscountState(Integer discountState) {
		this.discountState = discountState;
	}

	@Column(name = "DISCOUNT_SCHEME", length = 50)
	public String getDiscountScheme() {
		return this.discountScheme;
	}

	public void setDiscountScheme(String discountScheme) {
		this.discountScheme = discountScheme;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "CREATE_TIME", length = 19)
	public Date getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "UPDATE_TIME", length = 19)
	public Date getUpdateTime() {
		return this.updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	@Column(name = "GOODS_HOLD_ONE")
	public String getGoodsHoldOne() {
		return this.goodsHoldOne;
	}

	public void setGoodsHoldOne(String goodsHoldOne) {
		this.goodsHoldOne = goodsHoldOne;
	}

	@Column(name = "GOODS_HOLD_TWO")
	public String getGoodsHoldTwo() {
		return this.goodsHoldTwo;
	}

	public void setGoodsHoldTwo(String goodsHoldTwo) {
		this.goodsHoldTwo = goodsHoldTwo;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "discount")
	public Set<OrderInfo> getOrderInfos() {
		return this.orderInfos;
	}

	public void setOrderInfos(Set<OrderInfo> orderInfos) {
		this.orderInfos = orderInfos;
	}

}
